home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 May: Tool Chest / Dev.CD May 98 TC.toast / Tool Chest / Development Kits / HyperCard Related / APDA HyperCard Toolkits / HyperCard CTB Toolkit 1.0b2 / Source Code / CTBSendDone.p < prev    next >
Encoding:
Text File  |  1995-02-07  |  1.6 KB  |  68 lines  |  [TEXT/MPS ]

  1. (*
  2.     CTBSendDone() -- Return true if there is a write which has not completed yet.
  3.  
  4.     To compile and link this file using Macintosh Programmer's Workshop,
  5.  
  6.         pascal -w CTBSendDone.p
  7.         link -m ENTRYPOINT -o HyperCommands -rt XFCN=2762 -sn Main=CTBSendDone ∂
  8.             CTBSendDone.p.o "{MPW}"Libraries:interface.o "{MPW}"Libraries:Libraries:HyperXLib.o
  9.  
  10.     © Copyright 1990 by Apple Computer, Inc.
  11.  
  12.     Initial coding 2/90 by Harry R. Chesley.
  13. *)
  14.  
  15. {$R-}
  16.  
  17. {$S CTBSendDone }     { Segment name must be the same as the command name. }
  18.  
  19. unit DummyUnit;
  20.  
  21. interface
  22.  
  23. uses MemTypes, QuickDraw, OSIntf, ToolIntf, CTBUtils, FTIntf, CMIntf, TMIntf, CRMIntf, HyperXCmd;
  24.  
  25. procedure EntryPoint(paramPtr: XCmdPtr);
  26.     
  27. implementation
  28.  
  29. procedure CTBSendDone(paramPtr: XCmdPtr); forward;
  30.  
  31. procedure EntryPoint(paramPtr: XCmdPtr);
  32.  
  33.     begin
  34.         CTBSendDone(paramPtr);
  35.     end;
  36.  
  37. procedure CTBSendDone(paramPtr: XCmdPtr);
  38.  
  39.     {$I CTBUtil.inc}
  40.  
  41.     var sizes: CMBufferSizes;
  42.         status: CMStatFlags;
  43.         s: Str255;
  44.  
  45.     procedure Fail(errMsg: Str255); { set theResult and quit }
  46.         begin
  47.             paramPtr^.returnValue := PasToZero(paramPtr,errMsg);
  48.             exit(CTBSendDone);
  49.         end;
  50.  
  51.     begin
  52.         { Check the parameter count. }
  53.         if paramPtr^.paramCount <> 0 then Fail('Invalid parameter count');
  54.  
  55.         { Check that the Comm Toolbox is here. }
  56.         CTBReady;
  57.  
  58.         { Get the outstanding bytes info. }
  59.         if Globals^^.connHand = nil then status := 0
  60.         else if CMStatus(Globals^^.connHand,sizes,status) <> noErr then status := 0;
  61.         { Convert it to a string and return it. }
  62.         if BAnd(status,cmStatusDWPend) <> 0 then s := 'false'
  63.         else s := 'true';
  64.         paramPtr^.returnValue := PasToZero(paramPtr,s);
  65.     end;
  66.  
  67. end.
  68.